package com.eastfair.builder.entity;

import cn.afterturn.easypoi.excel.annotation.Excel;
import cn.afterturn.easypoi.excel.annotation.ExcelEntity;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import com.eastfair.core.base.entity.Entity;
import java.time.LocalDateTime;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableField;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.time.LocalDateTime;
import java.util.HashMap;
import java.util.Map;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.ToString;
import lombok.experimental.Accessors;
import static com.eastfair.core.utils.DateUtils.DEFAULT_DATE_TIME_FORMAT;
import com.eastfair.annotation.model.EchoVO;
import com.eastfair.builder.enumeration.ReportDrawingCategoryAuditStatusEnum;

import static com.baomidou.mybatisplus.annotation.SqlCondition.LIKE;

/**
 * <p>
 * 实体类
 * 报馆图纸分类
 * </p>
 *
 * @author dq
 * @since 2022-08-06
 */
@Data
@NoArgsConstructor
@ToString(callSuper = true)
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("bd_report_drawing_category")
@ApiModel(value = "ReportDrawingCategory", description = "报馆图纸分类")
@AllArgsConstructor
public class ReportDrawingCategory extends Entity<Long> implements EchoVO {

    private static final long serialVersionUID = 1L;
    @TableField(exist = false)
    private Map<String, Object> echoMap = new HashMap<>();
    /**
     * 是否启用：1是；0否
     */
    @ApiModelProperty(value = "是否启用：1是；0否")
    @TableField(value = "is_enabled")
    @Excel(name = "是否启用：1是；0否")
    private Integer isEnabled;

    /**
     * 是否删除：1是；0否
     */
    @ApiModelProperty(value = "是否删除：1是；0否")
    @TableField(value = "is_deleted")
    @Excel(name = "是否删除：1是；0否")
    private Integer isDeleted;

    /**
     * 项目id
     */
    @ApiModelProperty(value = "项目id")
    @TableField(value = "project_id")
    @Excel(name = "项目id")
    private Long projectId;

    /**
     * 子系统id
     */
    @ApiModelProperty(value = "子系统id")
    @TableField(value = "subsystem_id")
    @Excel(name = "子系统id")
    private Long subsystemId;

    /**
     * 租户id
     */
    @ApiModelProperty(value = "租户id")
    @TableField(value = "tenant_id")
    @Excel(name = "租户id")
    private Long tenantId;

    /**
     * 报馆ID
     */
    @ApiModelProperty(value = "报馆ID")
    @TableField(value = "report_space_id")
    @Excel(name = "报馆ID")
    private Long reportSpaceId;

    /**
     * 图片分类ID
     */
    @ApiModelProperty(value = "图片分类ID")
    @TableField(value = "drawing_category_id")
    @Excel(name = "图片分类ID")
    private Long drawingCategoryId;

    /**
     * 图片分类名称
     */
    @ApiModelProperty(value = "图片分类名称")
    @Size(max = 100, message = "图片分类名称长度不能超过100")
    @TableField(value = "drawing_category_name", condition = LIKE)
    @Excel(name = "图片分类名称")
    private String drawingCategoryName;

    /**
     * 图片分类序号
     */
    @ApiModelProperty(value = "图片分类序号")
    @TableField(value = "drawing_category_sort")
    @Excel(name = "图片分类序号")
    private Integer drawingCategorySort;

    /**
     * 是否双层：0-否，1-是
     */
    @ApiModelProperty(value = "是否双层：0-否，1-是")
    @TableField(value = "is_double")
    @Excel(name = "是否双层：0-否，1-是")
    private Integer isDouble;

    /**
     * 是否吊点：0-否，1-是
     */
    @ApiModelProperty(value = "是否吊点：0-否，1-是")
    @TableField(value = "is_point")
    @Excel(name = "是否吊点：0-否，1-是")
    private Integer isPoint;

    /**
     * 审核状态 #{NOT_SUBMIT:未提交;SUBMIT:已提交;APPROVED:审核通过;NOT_APPROVED:审核未通过}
     */
    @ApiModelProperty(value = "审核状态 #{NOT_SUBMIT:未提交;SUBMIT:已提交;APPROVED:审核通过;NOT_APPROVED:审核未通过}")
    @TableField(value = "audit_status")
    @Excel(name = "审核状态 #{NOT_SUBMIT:未提交;SUBMIT:已提交;APPROVED:审核通过;NOT_APPROVED:审核未通过}", replace = {"未提交_NOT_SUBMIT", "已提交_SUBMIT", "审核通过_APPROVED", "审核未通过_NOT_APPROVED",  "_null"})
    private ReportDrawingCategoryAuditStatusEnum auditStatus;

    /**
     * 审核意见
     */
    @ApiModelProperty(value = "审核意见")
    @Size(max = 200, message = "审核意见长度不能超过200")
    @TableField(value = "audit_opinion", condition = LIKE)
    @Excel(name = "审核意见")
    private String auditOpinion;

    /**
     * 提交时间
     */
    @ApiModelProperty(value = "提交时间")
    @TableField(value = "report_time")
    @Excel(name = "提交时间", format = DEFAULT_DATE_TIME_FORMAT, width = 20)
    private LocalDateTime reportTime;

    /**
     * 审核时间
     */
    @ApiModelProperty(value = "审核时间")
    @TableField(value = "audit_time")
    @Excel(name = "审核时间", format = DEFAULT_DATE_TIME_FORMAT, width = 20)
    private LocalDateTime auditTime;


    @Builder
    public ReportDrawingCategory(Long id, Long createdBy, LocalDateTime createTime, Long updatedBy, LocalDateTime updateTime, 
                    Integer isEnabled, Integer isDeleted, Long projectId, Long subsystemId, Long tenantId, 
                    Long reportSpaceId, Long drawingCategoryId, String drawingCategoryName, Integer drawingCategorySort, Integer isDouble, Integer isPoint, 
                    ReportDrawingCategoryAuditStatusEnum auditStatus, String auditOpinion, LocalDateTime reportTime, LocalDateTime auditTime) {
        this.id = id;
        this.createdBy = createdBy;
        this.createTime = createTime;
        this.updatedBy = updatedBy;
        this.updateTime = updateTime;
        this.isEnabled = isEnabled;
        this.isDeleted = isDeleted;
        this.projectId = projectId;
        this.subsystemId = subsystemId;
        this.tenantId = tenantId;
        this.reportSpaceId = reportSpaceId;
        this.drawingCategoryId = drawingCategoryId;
        this.drawingCategoryName = drawingCategoryName;
        this.drawingCategorySort = drawingCategorySort;
        this.isDouble = isDouble;
        this.isPoint = isPoint;
        this.auditStatus = auditStatus;
        this.auditOpinion = auditOpinion;
        this.reportTime = reportTime;
        this.auditTime = auditTime;
    }

}
